<template>
  <div class="banner">
    <!-- 轮播图组件 -->
    <van-swipe class="my-swipe" :autoplay="2000" >
      <van-swipe-item v-for="(item,index) in swiperlist" :key="index">
        <img :src="item.bannerUrl" alt="">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import {banner_list} from '../utils/api'

export default {
  data(){
    return{
      swiperlist:[],
    }
  },
  mounted(){
    banner_list().then((res)=>{
      this.swiperlist = res.data.list;
      // console.log(this.swiperlist);
    })
  }
}
</script>

<style lang='scss' scoped>
.banner{
  margin: 10px;
}
.my-swipe{
  border-radius: 10px;
  width: 100%;
  height: 150px;
}
.my-swipe img{
  width: 100%;
  height: 150px;
}
</style>